package greenhouse.control;

import java.util.*;

public class ControllerBroker {
	
	private ControllerBroker(){}
	
	private static ControllerBroker instance = new ControllerBroker();
	
	public static ControllerBroker getInstance(){
		return instance;
	}
	
	private static Hashtable ghDB = new Hashtable();
	
	static{
		ghDB.put("0001", "water");
		ghDB.put("0002", "water");
		ghDB.put("0003", "light");
		ghDB.put("0004", "water");
		ghDB.put("0005", "temperature");
		
	}
	
	public String getQuote(String event){
		return (String)ghDB.get(event); 
	}
	
	public Controller collectInfo(ControllerRequest request){
		String events[] = request.getGh();
		Controller cont = new Controller();
		for(int i=0; i<events.length; i++){
		cont.addQuote(events[i], getQuote(events[i]));
		}
		return cont;
	}

}
